package c1705;

import java.util.Scanner;

public class F {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int m = cin.nextInt();
        for (int i = 1; i < m; i++) {
            long left = i + 1, right = m;
            while (left <= right) {
                long j = (left + right) / 2;
                long s = (i + j) * (j - i + 1) / 2;
                if (s == m) {
                    System.out.println(i + " " + j);
                    break;
                } else if (s > m) {
                    right = j - 1;
                } else {
                    left = j + 1;
                }

            }
        }
    }
}